home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_basi
/
n_b-v200.zip
/
NB01
/
DMO
/
KB-KEY2$.DMO
< prev
next >
Wrap
Text File
|
1996-03-11
|
4KB
|
58 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME KB-KEY2$.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7, 0
CLS
? "┌─────────────────────────────────────────────────────────────────
? "│ fKey2Keyboard% ( ScanCode?, Asci? )
? "│ fStr2Keyboard? (SEG ANY)
? "│ fPutKey? (SEG KeyPress%)
? "├────────────────────────────────────────────────────────────────────────
? "│ Sometimes it is a handy thing to be able to put a key press or a whole
? "│ string into the keyboard buffer. These 2 functions allow you to do that
? "│ quite easily. fKey2Keyboard% is the antithesis of fINKEY% in that you
? "│ pass the scancode/asciicode for any one key while fStr2Keyboard? will
? "│ put up to 16(?) characters in there for you just after it clears the
? "│ buffer.
? "└──────────────────────────────────────────────────────────────────────────────
'┌─────────────────────
I$ = "This is a test" '│ something to load
D$ = "There are ## key presses in the buffer." '│ our display $
CharsIn? = fStr2Keyboard?( I$ ) '│ stuff I$
fKey2Keyboard 1, 27 '│ stuff <ESC>
'│
'fPutKey 27 '│ stuff <ESC> but
'│ but clears keyboard
'│
PRINT USING D$; CharsIn? '│ display char count
PRINT '│
DELAY 1 '│ pause for effect
DO '│
G$ = INKEY$ '│ read the buffer
IF G$ = CHR$(027) THEN EXIT LOOP '│ exit loop on <esc>
PRINT G$; '│
LOOP '│
'│
PRINT : PRINT '│ next line & skip one
PRINT "<< ALL DONE! >>" '│ out of the loop!
'└─────────────────────